<script language="javascript">
$(document).ready(function(){
    $('#select').live('change',function(){
        
    
 if($('select option:selected').val()=='select'){
     $('#option_values').fadeIn(700);
 }else{
      $('#option_values').fadeOut(700);
 }       
    });
 
});
</script>
<h2>Add Profile fields</h2>   
  <table id="table" width="900px" cellpadding="5" cellspacing="5">
    <tr>
        <td>
            <?php echo $this->Form->Create('Profilefield'); ?>
            <table cellpadding="10" cellspacing="10">
                <tr>
                    <td id="label" >Title</td>
                    <td><?php echo $this->Form->input('Profilefield.title', array('label' => '','size'=>'50')); ?></td>
                </tr>                
                <tr>
                    <td id="label"  >Type</td>
                    <td><?php echo $this->Form->input('Profilefield.type', array('label' => '','id'=>'select','options'=>array('text'=>'text','textarea'=>'textarea','select'=>'select','checkbox'=>'checkbox'))); ?></td>
                </tr>
                <tr id="option_values" style="display: none;">
                    <td id="label"  >Option for select drop-down</td>
                    <td><?php echo $this->Form->input('Profilefield.value', array('label' => '','type'=>'textarea','rows'=>'10','cols'=>'50')); ?>* In CSV(e.g. 1,2,3,4) form</td>
                </tr> 
                <tr>
                    <td id="label"  >Question</td>
                    <td><?php echo $this->Form->input('Profilefield.question', array('label' => '','size'=>'60')); ?></td>
                </tr> 
                 <tr>
                    <td id="label"  >Show in profile page</td>
                    <td><?php echo $this->Form->input('Profilefield.status', array('label' => '')); ?></td>
                </tr>   
                
                
                <tr><td></td><td></td></tr>
            </table>
				<?php echo $this->Form->end('Add'); ?>
        </td>
    </tr>
</table>